package com.boot.admin.modules.sys.ai.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.boot.admin.data.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * AI对话会话表
 *
 * @author 李飞洋
 * @date 2025/9/24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString
@TableName("ai_conversation")
public class AiConversation extends BaseEntity {
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 角色ID
     */
    private String roleId;
    /**
     * 会话标题
     */
    private String title;
    /**
     * 会话状态 1:进行中 2:已结束
     */
    private Integer status;
    /**
     * 最后消息时间
     */
    private LocalDateTime lastMessageTime;
    /**
     * 是否启用
     */
    private Integer isEnabled;

    public boolean isActive() {
        return status == 1;
    }

    public boolean isEnabled() {
        return isEnabled == 1;
    }
}